package com.shiguiwu.springmybatis.spring.conditional.annotation;

import com.shiguiwu.springmybatis.spring.conditional.EnvCondition;
import org.springframework.context.annotation.Conditional;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @description:
 * @author: stone
 * @date: Created by 2021/10/8 22:02
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springmybatis.spring.conditional.annotation
 */
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
//自定义注解的时候，一定要指定这个
@Conditional(EnvCondition.class)
public @interface MyEnvCondition {
    Env value() default Env.DEV;

    enum Env {
        DEV, TEST, PRODUCT
    }
}
